#ifndef USER_H
#define USER_H

#define ADMIN_USER_ID 5
#define ADMIN_USER_NAME "admin"

#define MAX_USER_ID 29
#define FIRST_USER_ID 9

#define PI (3.14)

// RUN: /clang_llvm_15/bin/clang++ -cc1 -load cmake-build-debug/libCodeStyleChecker.so -plugin CSC test/macro_def_func_3.cpp


#define SIGNAL1 SignalName1
#define SIGNAL2 SignalName2
#define INT int
#define DOUBLE double
#define FLOAT float


#define func_define(func_name,func_return_type,arg1_type,arg2_type) func_return_type  gen_func_ ## func_name (arg1_type _arg1,arg2_type _arg2)


func_define(mySum,INT,FLOAT,DOUBLE)
{
    int sum=(int)(_arg1+_arg2);
    return sum;
}
/**
int gen_func_mySum(float _arg1, double _arg2) {
    int sum = (int)(_arg1 + _arg2);
    return sum;
}
 */


class User{
public:
	static User* Table[];
	static int NextUserId;
	static int genNextUserId(){
		NextUserId++;
		return NextUserId;
	}

	static User* find(char* userName);
	static User* reg(char* userName,char* password);
	static void printTable();
private:
	int userId;
	char* userName;
	char* password;
public:
	User(int userId, char* userName, char* password){
		this->userId=userId;
		this->userName=userName;
		this->password=password;
	}
	
	~User(){}

	int getUserId(){
		char * tmp=ADMIN_USER_NAME;
		if (userId==ADMIN_USER_ID){
		//this_is_admin_user
		}
		return userId;
	}
	void setUserId(int userId){
		this->userId=userId;
	}
	char* getUserName(){
		return userName;
	}
	void setUserName(char* userName){
		this->userName=userName;
	}
};

#endif